A typical digital imaging system captures an image and after various manipulations, both automatic and interactive, displays an output image on a monitor, or prints out a hard copy of the image. Digital manipulations include algorithms to restore image degradations or to enhance image quality, for example by correcting for image balance or tonescale problems or for improving sharpness or reducing image structure artifacts. This invention is concerned with correcting the tonescale of images which, for example, have been captured in sub-optimal illumination conditions, or which have suffered a subsequent tonescale degradation.
There are a number of algorithms that attempt digitally to correct the tonescale of poor quality images by means of operator intervention, for example in U.S. Pat. No. 5,062,058 which requires operator selection of highlight and shadowpoints. There are some circumstances in which user or operator intervention is appropriate, but generally this introduces a subjective variation in resulting image quality, along with reduced productivity.
Additionally, there are a number of algorithms that attempt to overcome these problems by automatically correcting the tonescale of poor quality images, such as ‘Auto-levels’ in Adobe Photo-shop and U.S. Pat. No. 4,984,071. These generally include a linear tonescale correction in addition to a color balance correction, based on the determination of highlight and shadow points from a cumulative histogram. Hence the methods are based on gain and offset, and are typically aggressive, producing an unnatural tonescale with clipping in the shadow and highlight portions of the tonescale.
Other algorithms further modify the image tonescale by non-linear means. U.S. Pat. No. 5,812,286, for example, pins the ‘black ’ and ‘white’ point of each color and uses the median to modify a gamma value which provides a power-law transformation to the image.
U.S. Pat. No. 5,265,200 describes a method for automatic image saturation, gamma and exposure correction. The method disclosed for neutral tonescale transformation is implemented using a best-fit function, typically a second-order polynomial, which when applied to the image histogram, drives the histogram towards that of an ‘ideal’ image without artifacts that result from the capture process.
Both of these algorithms may, however, produce a tonescale that appears to be unnatural, and may produce either clipping or loss of detail in the shadow and highlight portions of the tonescale, or unacceptably low contrast in the central portion of the tonescale. Additionally, where there are large regions of the image that are relatively low in contrast or detail these areas will typically bias the analysis resulting in poor tonescale correction.
U.S. Pat. No. 5,822,453 describes a method for estimating and adjusting digital contrast in a logarithmic metric. This method computes a standard deviation for a histogram of sampled pixel values, more specifically those pixels that relate to high contrast (edge) information in the scene. The use of edge pixels minimizes effects of overemphasis of large flat regions or areas of texture in the scene. A target contrast is estimated by comparing the standard deviation with a predetermined contrast, and thereby produces a final reproduction tonescale transformation curve within pre-specified contrast limits. This method is logarithmically based and the algorithm is fairly highly tuned to that metric, making it inappropriate for the general non-logarithmic usage described earlier.
The invention aims to provide a method to digitally restore or enhance the neutral tonescale of images that does not depend on manual adjustments of brightness or contrast. The invention also aims to provide a method of restoring tonescale which provides a tonescale of natural appearance, and which minimizes clipping in the highlight portions of the image, whilst optimizing mid-tone contrast.